unit SrvMain;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, RzTabs, Vcl.ExtCtrls, RzPanel, RzSplit
  ,DmSrv, Vcl.StdCtrls, Vcl.ComCtrls,rtcInfo;

type
  TfrmSrv = class(TForm)
    rzspltr1: TRzSplitter;
    rzpgcntrl1: TRzPageControl;
    tstTabSheet1: TRzTabSheet;
    tstTabSheet2: TRzTabSheet;
    RzGroupBox1: TRzGroupBox;
    TrackBar1: TTrackBar;
    lbl1: TLabel;
    btn1: TButton;
    lbledt1: TLabeledEdit;
    procedure btn1Click(Sender: TObject);
    procedure TrackBar1Change(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmSrv: TfrmSrv;

implementation

{$R *.dfm}

procedure TfrmSrv.btn1Click(Sender: TObject);
begin
  if dtmdlSrv.rtchtpsrvr1.isListening then
    dtmdlSrv.rtchtpsrvr1.StopListen
  else
  begin
    dtmdlSrv.rtchtpsrvr1.ServerPort := RtcString(lbledt1.Text);
    dtmdlSrv.rtchtpsrvr1.Listen;
  end;
end;

procedure TfrmSrv.TrackBar1Change(Sender: TObject);
begin
  with TrackBar1 do
  begin
    ShowHint := true;
    case Position of
      0:
        hint := '652 KB';
      1:
        hint := '326 KB';
      2:
        hint := '128 KB';
      3:
        hint := '64 KB';
      4:
        hint := '32 KB';
      5:
        hint := '16 KB';
    end;
  end;
end;

end.
